package gl.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

public class CircleColorBGImageView extends RelativeLayout {

	public CircleColorBGImageView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	public CircleColorBGImageView(Context context, AttributeSet attrs,
			int defStyle) {
		super(context, attrs, defStyle);
		init();
	}

	private void init() {
	}

	private int bgcolor;
	private Paint bgPaint;
	int width = 0;

	@Override
	public void setBackgroundColor(int color) {
		this.bgcolor = color;
		this.bgPaint = new Paint();
		this.bgPaint.setColor(bgcolor);
		bgPaint.setAntiAlias(true);
		invalidate();
	}

	@Override
	public void draw(Canvas canvas) {
		if (bgPaint != null) {
			canvas.drawCircle(getWidth()/2, getWidth()/2, getWidth()/2, bgPaint);
		}
		super.draw(canvas);

	}

}
